package com.service;

import com.core.base.BaseMapper;
import com.core.base.BaseService;
import com.mapper.jpa.UsersRepository;
import com.model.jpa.Users;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import java.beans.IntrospectionException;
import java.lang.reflect.InvocationTargetException;


@Service
public class UserService extends BaseService<Users,Long> {

    @Autowired
    private UsersRepository usersRepository;



 //   @Override
    public BaseMapper<Users,Long> getMapper() {
        return usersRepository;
    }







    public Users getByUserName(String name){
        Users users = new Users();
        users.setRealName("大栗子");
//        Sort sort = new Sort(Sort.Direction.ASC, "id");
//        Pageable p = new PageRequest(1,2,sort);
        return usersRepository.findByUserName(name);
    }


    public static void main(String[] args) throws IllegalAccessException, IntrospectionException, InvocationTargetException {

    }


}
